﻿// 简易矢量图生成模型.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
#include <iostream>
#include <graphics.h>
#include "CShape.h"
#include "鼠标操作集合.h"
#include"智能指针.hpp"


//测试鼠标框选实现
void test01() {//实现三次鼠标框选测试
	initgraph(640, 480);
	IMAGE tmp;
	for(int i = 0; i < 3;)
		if (Getimage(&tmp))
			i++;
	getchar();
	closegraph();
}
//测试智能指针实现
void test02() {
	cout << "智能指针生成" << endl;
	{
		AutoPtr<POINT> titi = new POINT({ 10,20 });
		//cout << titi.m_num << '\t' << *titi.m_num << endl;
		//cout << titi.m_ptr << '\t' << (*titi.m_ptr).x << endl;
		AutoPtr<POINT> riri = titi;
		//cout << titi.m_num << '\t' << *titi.m_num << endl;
		//cout << titi.m_ptr << '\t' << titi->x << endl;
	}

}
//测试读取n个点实现
void test03() {
	initgraph(640, 480);
	int n = 0;
	AutoPtr<POINT> pPoint = getPoints(n);
	cout << n << "个点坐标:" << endl;
	for (int i = 0; i < n; ++i) {
		cout << "第" << i+1 << "个点：" << pPoint[i].x << " " << pPoint[i].y << endl;
	}
	getchar();
	closegraph();
}
void test04() {
	initgraph(640, 480);

	closegraph();
}
int main()
{
	//test01();
	//test02();
	test03();

	return 0;
}
